package cn.crex1.xiaomi.core.mvc.util;

public class ClassUtil {
	
	public static Class<?> loadDefineClass(String classname,ClassLoader classLoader){
		try {
			return classLoader.loadClass(classname);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		return null;
		
	}
	public static Object instanceClass(Class<?> clazz) {
		try {
			Object newInstance = clazz.newInstance();
			if (newInstance==null) {
				return clazz.getConstructor().newInstance();
			}
			return newInstance;
		} catch (Exception e) {
			e.printStackTrace();
		} 
		return null;		
	}
}
